<!--
	//搜索组件-文本框

		//控制器中设置类型
		$search_text = array(
			'0'=>'搜索类型',
			'1'=>'按标题',
			'2'=>'按内容',
		);
		$this->assign('search_text',$search_text);

		//视图中引用
		<includesxxx file='./Public/Template/Phone/Plugin/plugin_search_text.html' />	
-->
<div style='margin:0 0 10px 0;height:30px;border:0px solid;display:flex'>
	<div style='float:left;width:85px;line-height:20px;background:#8d8;border:0px solid #8d8;text-align:center;padding:1px'>
		<select id='search_text_type' style='cursor:pointer;height:100%;width:100%;border:1px solid #8d8;text-align:center;appearance:none;-moz-appearance:none;-webkit-appearance:none;'>
			<volist name='search_text' id='vo' item='key'>
				<option value='{$key}'>{$vo}</option>
			</volist>
			<option value='0'>不限</option>
		</select>
	</div>
	<div style='float:left;flex:1;border:1px solid #8d8'>
		<input name='search_text_content' style='height:100%;width:100%;' />
	</div>
	<div id='IndexMain_SearchButton' style='float:left;width:70px;line-height:30px;background:#8d8;text-align:center;cursor:pointer;'>
		搜索
	</div>
</div>
<script>
	$(function(){
		//信息搜索栏
		$('#IndexMain_SearchButton').click(function(){
			var SearchText_Type = $('#search_text_type').val();
			var SearchText_Content = $('input[name=search_text_content]').val().trim();
			sessionStorage.condition_SearchText_Type = SearchText_Type;
			sessionStorage.condition_SearchText_Content = SearchText_Content;
			//alert(sessionStorage.condition_SearchText_Type +'--'+ sessionStorage.condition_SearchText_Content);
		});

		//如果有条件缓存
		if(sessionStorage.condition_SearchText_Type){	
			//获取缓存
			var SearchText_TypeVal = sessionStorage.condition_SearchText_Type;
			//遍历所有option
			for(var i=0;i<$('#search_text_type').get(0).options.length;i++){
				//获取每个option的value值 
				var SearchText_OptionVal = $('#search_text_type').get(0).options[i].value;
				//如果option的value值等于缓存
				if(SearchText_OptionVal == SearchText_TypeVal){
					//设置该下标的选项为默认
					$('#search_text_type').get(0).selectedIndex=i;
				}
			}
		}
		//如果有缓存文本，则保持状态
		if(sessionStorage.condition_SearchText_Content){
			$('input[name=search_text_content]').val(sessionStorage.condition_SearchText_Content);
		}else{
			$('#search_text_type').get(0).selectedIndex=0;
		}
	});
</script>
<!--搜索组件-文本框 结束 -->